//
//  BMABillboard.m
//  LZMusicPlayer
//
//  Created by wulanzhou on 2016/11/1.
//  Copyright © 2016年 wulanzhou. All rights reserved.
//

#import "BMABillboard.h"
#import "NSString+CZExtend.h"

@implementation BMABillboard

/**
 * 所有音乐榜类别
 * @return
 */
- (NSString *) billCategory{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.billboard.billCategory"];
    [sb appendString:@"&kflag=1"];
    return sb;
}

/**
 * 音乐榜歌曲
 * @param type	类型 (1.新歌榜 2.热歌榜 7.叱咤歌曲榜 8.Billboard 11.摇滚榜 20.华语金曲榜 21.欧美金曲榜 22.经典老歌榜 23.情歌对唱榜 24.影视金曲榜 25.网络歌曲榜 100.King榜 200.原创音乐榜)
 * @param offset	偏移
 * @param size	获取数量
 * @return
 */
- (NSString *) billSongList:(int)type offset:(int)offset size:(int)size{
    
    NSString *strFields=@"song_id,title,author,album_title,pic_big,pic_small,havehigh,all_rate,charge,has_mv_mobile,learn,song_source,korean_bb_song";
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.billboard.billList"];
    [sb appendFormat:@"&type=%d",type];
    [sb appendFormat:@"&offset=%d",offset];
    [sb appendFormat:@"&size=%d",size];
    [sb appendFormat:@"&fields=%@",[strFields URLEncode]];
    
   
    return sb;
}

/**
 新歌榜(前4条)
 
 @return url
 */
- (NSString *) newestBillSongList{

    return [self billSongList:1 offset:0 size:3];
}

@end
